package com.learn.designPatterns.behavioral.chainOfResponsibility;

/**
 * @classname:
 * @Description:
 * @author: yfpu
 * @Date: 2018-09-12 19:21
 */
public class ConcreteHandler1 extends Handler{


    public ConcreteHandler1(Handler successor) {
        super(successor);

    }

    @Override
    protected void handleRequest(Request request) {

        if (request.getRequestType().equals(RequestType.TYPE_1)) {
            System.out.println(request.getName() + "is handle by ConcreteHandler1");

        } else if (successor != null){
            successor.handleRequest(request);
        }

    }
}
